<!--
 * @Autor: 王琛
 * @Description: 图片承载页面
 * @Copyright: 版权归个人所有
-->
<style lang="stylus" scoped>
#IamgePage {
  width: 100%;
  height: 100%;
  position: relative;

  .MainBg {
    width: 100%;
    height: 100%;
  }
}
</style>


<template>
  <div id="IamgePage">
    <!-- 图片承载页面 -->
    <img class="MainBg" :src="`${_data.PageConfig?.PageImgRoot}${_data.PageConfig?.MainImg}`" alt="Image"/>
  </div>
</template>


<script setup lang="ts" name="IamgePage">
import {useRoute} from "vue-router";
import {onMounted, reactive} from "vue";
import {useMainStore} from "src/pinia";


const _state = useMainStore();
const _route = useRoute();


const _data = reactive({
  // 页面配置
  PageConfig: {},

})

onMounted(() => {
  InitPageData();
})

/**
 * @description: 初始化楼层数据
 * @author: 王琛
 * @Date: 2025-04-26 00:13:45
 * @param {*}
 * @return {*}
 */
function InitPageData() {
  try {
    const PageConfigKey = _route.query?.PageConfigKey || false;

    if (!PageConfigKey) throw new Error('没有传入页面配置参数');

    const PageConfig = _state.pageDataConfig?.PageConfig[PageConfigKey] || false;

    if (!PageConfig) throw new Error('没有找到页面配置参数');

    _data.PageConfig = PageConfig;

  } catch (e) {
    console.error('%c捕获报错-00:13:45', 'color:#fff;fontSize:15px;background:#993366;padding:2px 5px;border-radius:6px', e.message);
  }
}
</script>